/**
 * 
 */
package com.sci.web.action.datareportseason;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import com.sci.web.action.util.BaseAction;
import com.sci.web.dao.DataReportM_BaseInfoDao;

/**
 * @author  BaiFuyou
 * @date: Nov 4, 2011 2:52:08 PM
 * 
 * 对一条数据进行更新处理
 */
public class UpdateBenefitData_BaseInfoAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5801481384451941146L;
	@Resource
	private DataReportM_BaseInfoDao dataReportM_BaseInfoDao;
	private int id;
	private String year;
	private double benefit_major_business_lastyear_sale;
	private double benefit_profit;
	private double benefit_profit_tax;
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * @return the year
	 */
	public String getYear() {
		return year;
	}
	/**
	 * @param year the year to set
	 */
	public void setYear(String year) {
		this.year = year;
	}
	/**
	 * @return the benefit_major_business_lastyear_sale
	 */
	public double getBenefit_major_business_lastyear_sale() {
		return benefit_major_business_lastyear_sale;
	}
	/**
	 * @param benefit_major_business_lastyear_sale the benefit_major_business_lastyear_sale to set
	 */
	public void setBenefit_major_business_lastyear_sale(double benefit_major_business_lastyear_sale) {
		this.benefit_major_business_lastyear_sale = benefit_major_business_lastyear_sale;
	}
	/**
	 * @return the benefit_profit
	 */
	public double getBenefit_profit() {
		return benefit_profit;
	}
	/**
	 * @param benefit_profit the benefit_profit to set
	 */
	public void setBenefit_profit(double benefit_profit) {
		this.benefit_profit = benefit_profit;
	}
	/**
	 * @return the benefit_profit_tax
	 */
	public double getBenefit_profit_tax() {
		return benefit_profit_tax;
	}
	/**
	 * @param benefit_profit_tax the benefit_profit_tax to set
	 */
	public void setBenefit_profit_tax(double benefit_profit_tax) {
		this.benefit_profit_tax = benefit_profit_tax;
	}
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		super.setContentType(super.JSON);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("benefit_id", id);
		map.put("benefit_year", year);
		map.put("benefit_major_business_lastyear_sale", benefit_major_business_lastyear_sale);
		map.put("benefit_profit", benefit_profit);
		map.put("benefit_profit_tax", benefit_profit_tax);
		if(dataReportM_BaseInfoDao.updateEnterpriseBenefitDataById(map)){
			super.outPrint("ok");			
		}else{
			super.outPrint("fail");
		}
		return "json";
	}

}
